/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Gleydson
 */
@Entity
@Table(name = "backup")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Backup.findAll", query = "SELECT b FROM Backup b"),
    @NamedQuery(name = "Backup.findByCodbackup", query = "SELECT b FROM Backup b WHERE b.codbackup = :codbackup"),
    @NamedQuery(name = "Backup.findByData", query = "SELECT b FROM Backup b WHERE b.data = :data"),
    @NamedQuery(name = "Backup.findByHora", query = "SELECT b FROM Backup b WHERE b.hora = :hora"),
    @NamedQuery(name = "Backup.findByPath", query = "SELECT b FROM Backup b WHERE b.path = :path")})
public class Backup implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "codbackup")
    private Integer codbackup;
    @Column(name = "data")
    @Temporal(TemporalType.DATE)
    private Date data;
    @Column(name = "hora")
    @Temporal(TemporalType.TIME)
    private Date hora;
    @Column(name = "path")
    private String path;
    @JoinColumn(name = "login", referencedColumnName = "login")
    @ManyToOne
    private Administrador login;

    public Backup() {
    }

    public Backup(Integer codbackup) {
        this.codbackup = codbackup;
    }

    public Integer getCodbackup() {
        return codbackup;
    }

    public void setCodbackup(Integer codbackup) {
        this.codbackup = codbackup;
    }

    public Date getData() {
        return data;
    }

    public void setData(Date data) {
        this.data = data;
    }

    public Date getHora() {
        return hora;
    }

    public void setHora(Date hora) {
        this.hora = hora;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public Administrador getLogin() {
        return login;
    }

    public void setLogin(Administrador login) {
        this.login = login;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codbackup != null ? codbackup.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Backup)) {
            return false;
        }
        Backup other = (Backup) object;
        if ((this.codbackup == null && other.codbackup != null) || (this.codbackup != null && !this.codbackup.equals(other.codbackup))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Backup[ codbackup=" + codbackup + " ]";
    }
    
}
